import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';  // <-- #1 import module
import { MatDialogModule, MatButtonModule } from '@angular/material';

// bootstrap 模态窗
import { ModalModule } from 'ngx-bootstrap/modal';
// bootstrap 分页
import { PaginationModule } from 'ngx-bootstrap/pagination';

// 时间控件
import { MyDatePickerModule } from 'mydatepicker';
import { DateComponent } from '../component/date/date.component';

// 文件上传
import { FileUploadModule } from 'ng2-file-upload';
import { FileUploaderSingleComponent } from '../component/file-uploader/file.uploader.single.component';
import { FileUploaderMultipleComponent } from '../component/file-uploader/file.uploader.multiple.component';

// 表格
import { GridComponent } from '../component/grid/grid.component';
// 分页
import { PagingComponent } from '../component/paging/paging.component';
// 提示
import { NoticeComponent } from '../component/notice/notice.component';
// 图片裁剪
import { ImgCropperComponent } from '../component/img-cropper/img.cropper.component';
import { MyCropperComponent } from '../component/img-cropper/my.cropper.component';
// 确认提示
import { ConfirmDialogComponent } from '../component/confirm/confirm.dialog.component';

// 阻止事件冒泡指令
import { StopPropagationDirective } from '../directive/stop.propagation.directive';

// httpService
import { HttpService } from '../http/http.service';
// 确认提示
import { ConfirmDialogService } from '../service/confirm.service';

@NgModule({
  declarations: [
    GridComponent,
    PagingComponent,
    NoticeComponent,
    DateComponent,
    FileUploaderSingleComponent,
    FileUploaderMultipleComponent,
    ImgCropperComponent,
    MyCropperComponent,
    ConfirmDialogComponent,
    StopPropagationDirective
  ],
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    MyDatePickerModule,
    FileUploadModule,

    MatDialogModule,
    MatButtonModule,

    ModalModule.forRoot(),
    PaginationModule.forRoot(),
  ],
  exports: [
    GridComponent,
    PagingComponent,
    NoticeComponent,
    DateComponent,
    FileUploaderSingleComponent,
    FileUploaderMultipleComponent,
    ImgCropperComponent,
    StopPropagationDirective
  ],
  providers: [
    HttpService,
    ConfirmDialogService,
  ],
  entryComponents: [ConfirmDialogComponent]
})
export class ShareModule { }
